module test_forlab_m

    use testdrive, only: new_unittest, unittest_type, error_type, check
    use forlab_m, only: mean
    implicit none
    private

    public :: collect_forlab

contains

    !> Collect all exported unit tests
    subroutine collect_forlab(testsuite)
        !> Collection of tests
        type(unittest_type), allocatable, intent(out) :: testsuite(:)

        testsuite = [ &
                    new_unittest("FCN: mean", test_mean) &
                    ]

    end subroutine collect_forlab

    subroutine test_mean(error)
        type(error_type), allocatable, intent(out) :: error
        call check(error, mean([1.0, 3.0]), 2.0)
    end subroutine test_mean

end module test_forlab_m
